//
// Created by denglibin on 2021/5/31.
//

#include "rect_spirit.h"
#include "malloc.h"
/**
 * 创建
 * @param x
 * @param y
 * @return
 */
RectSpirit * RectSpiritCreateDefault(int x, int y){
    RectSpirit* rectSpirit = (RectSpirit*) malloc(sizeof(RectSpirit));
    rectSpirit->x = x;
    rectSpirit->y = y;
    rectSpirit->x_speed = 2;
    rectSpirit->y_speed = 2;
    rectSpirit->rect_w = 50;
    rectSpirit->rect_h = 50;
    rectSpirit->x_direction = 0;
    rectSpirit->y_direction = 0;
    return rectSpirit;
}
/**
 * 释放
 * @param rectSpirit
 */
void RectSpiritFree(RectSpirit* rectSpirit){
    free(rectSpirit);
}